package com.comparator.comparator1;

import java.util.Comparator;

public class SortByEmployeeAge implements Comparator{

	@Override
	public int compare(Object obj1, Object obj2) {
		Employee e1=(Employee)obj1;
		Employee e2=(Employee)obj2;
		Integer age1=e1.getAge();
		Integer age2=e2.getAge();
		return age1.compareTo(age2);
	}

}
